package com.humble.bean;/*
  humble keep gonging
*/

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.HashMap;
import java.util.Map;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class Message {
    //请求成功与否的状态
    private int status;
    //响应信息提示
    private String tips;
    //响应信息
    private Map<String,Object> mes;

    public Message(int status,String tips){
        this.status=status;
        this.tips=tips;
        this.mes=new HashMap<String,Object>();
    }

    public void addMes(String key,Object value){
        this.mes.put(key,value);
    }

    public static Message success(){
        return new Message(200,"success");
    }

    public static Message fail(){
        return new Message(400,"fail");
    }
}
